local s15__jinzi = fk.CreateSkill {
  name = "s15__jinzi",
}

Fk:loadTranslationTable {
  ["s15__jinzi"] = "锦姿",
  [":s15__jinzi"] = "每轮限一次，你可将一张装备牌当不计入次数的【杀】使用。",

  ["#s15__jinzi"] = "锦姿",
}

s15__jinzi:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#s15__jinzi",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip and
        player:usedSkillTimes(s15__jinzi.name, Player.HistoryRound) == 0
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return nil end
    local card = Fk:cloneCard("slash")
    card:addSubcard(cards[1])
    card.skillName = s15__jinzi.name
    return card
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryRound) == 0
  end,
  enabled_at_response = function(self, player, response)
    return not response
  end,
})

-- 添加"目标修改"效果（绕过使用次数限制）
s15__jinzi:addEffect("targetmod", {
  -- 绕过次数限制的函数
  bypass_times = function(self, player, skill, scope, card)
    return card and scope == Player.HistoryPhase and
        table.contains(card.skillNames, s15__jinzi.name) -- 如果是此技能生成的杀且在阶段历史中，则绕过次数限制
  end,
})

return s15__jinzi
